Embodiments relate generally to data transfers in computer systems, and more particularly, to direct memory access (DMA) data transfers.
A computer system may include a central processing unit (CPU) or processor, a memory, a bus, and a device attached to an input/output (I/O) port. A wide variety of devices may be attached to a computer. For example, an external storage device, a network interface card, or an input or output device controller, such as a key board or sound card, may be attached to a computer.
A processor executes instructions contained in a computer program. Certain program instructions, when executed by the processor, cause data to be transferred from memory to a port or from a port to memory. This is sometimes referred to as programmed memory input/output. DMA is another technique for transferring data. Once a DMA transfer is initiated, the data transfer bypasses the processor. A separate circuit, such as a DMA controller, temporarily takes control of the bus away from the processor and transfers data from memory to an attached device or from the attached device to memory. DMA hardware may provide one or more I/O channels that allow data transfers independent of the CPU. An advantage of transferring data using a hardware circuit, such as DMA controller, is that the processor may perform other work while the transfer is taking place. Another advantage is that the transfer may be faster than transferring the data using processor instructions.